module.exports = function (app) {
    const {
      Bone,
      DataTypes: { STRING, BOOLEAN, DATE, JSON, BIGINT },
    } = app.model;
    class Menu extends Bone {
      static table = 'menu';
      static attributes = {
        id: {
          type: BIGINT,
          primaryKey: true,
        },
        // 父级菜单ID
        parentId: {
          type: BIGINT,
          validate: {
            notEmpty: true,
            notNull: true,
          },
        },
        name: {
          type: STRING,
          defaultValue: '',
        },
        // 菜单类型(MENU:菜单；CATALOG:目录；EXTLINK:外链；Button:按钮)
        type: {
          type: STRING,
        },
        // 路由地址
        path: {
          type: STRING,
          defaultValue: ''
        },
        // 组件地址
        component: {
          type: STRING,
          defaultValue: ''
        },
        // 排序
        sort: {
          type: BIGINT,
          defaultValue: 2,
        },
        // 权限标识
        perm: {
          type: STRING,
          defaultValue: ''
        },
        // 显示状态(1-显示;0-隐藏)
        visible: {
          type: BIGINT,
          defaultValue: 1
        },
        // 菜单图标
        icon: {
          type: STRING,
          defaultValue: ''
        },
        // 跳转路径
        redirect: {
          type: STRING,
          defaultValue: ''
        },
        // 菜单状态(1-正常;0-停用)
        status: {
          type: BIGINT,
          defaultValue: 1
        },
        updatedAt: {
          type: DATE,
        },
        createdAt: {
          type: DATE,
        },
        deleteAt: {
          type: DATE,
        },
      };
    }
    return Menu;
  };
  